﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LeadVinaglue.Models.ViewPages;
using LeadVinaglue.Models;

namespace LeadVinaglue.Repository
{
    public class StateManagementRepository : BaseManagementRepository
    {
        LeadVinaglueEntities entities = new LeadVinaglueEntities();

        public StateManagementModel GetModel(string pageType, string roleName, string id)
        {
            StateManagementModel model = new StateManagementModel();

            model.HeaderView = GetHeader();
            model.MenuItem = GetMenuItems(roleName, pageType);
            model.ListState = new Repository.StateRepository().GetAll();
            if (!string.IsNullOrEmpty(id))
            {
                model.StateInfo = new Repository.StateRepository().GetSingle(id);
            }

            return model;
        }

        public StateManagementModel GetModel(string pageType, string roleName)
        {
            StateManagementModel model = new StateManagementModel();
            model.ListState = new Repository.StateRepository().GetAll();

            return model;
        }
    }
}